Ext.onReady(function() {
		
    var converted = new Ext.form.ComboBox( {
        typeAhead : true,
        triggerAction : 'all',
        transform : 'state',
        width : 135,      
        forceSelection : true,
        fieldLabel : 'Send To',
        name : 'to',
        pageSize:5,
        resizable:true,
        lazyRender : true,
        anchor : '100%' // anchor width by percentage
    });
	
    
    /*var store = new Ext.data.Store( {
        proxy : new Ext.data.HttpProxy( {
            //url : '../hf/accountManager.do?action=ajaxAccountList'
        	url:''
        }),
        reader : new Ext.data.JsonReader( {}, [ {
            name : 'id'
        }, {
            name : 'name'
        }])
    });*/
	var store=new Ext.data.JsonStore({
			        url: '../hf/treeMenu.do?action=getImages',
			        baseParams :{imageDir :'/images/menu/2/icon/'},
			        root: 'images',
			        fields: ['name', 'url']
			    });
    
    //store.load();

    var comboBox = new Ext.ux.ComboImage( {
        store : store,
        emptyText : '请选择',
        triggerAction : 'all',
        displayField : 'name',
		valueField:'url',
        fieldLabel : '字段类型',
        anchor : '100%',
        readOnly : true,
        resizable:true
    });

    var form = new Ext.form.FormPanel( {
        baseCls : 'x-plain',
        labelWidth : 100,
        url : 'save-form.php',
        //defaultType : 'textfield',
        frame:true,
        items : [converted, comboBox, {
            fieldLabel : 'Send To',
            name : 'to',
            height:100,
            xtype:'textfield',
            anchor : '100%' // anchor width by percentage
            }, {
                fieldLabel : 'Subject',
                name : 'subject',
                anchor : '100%', // anchor width by percentage
                xtype:'textfield'
            },{
                 layout:'table',
                 autoHeight:true,
                 baseCls : 'x-plain',
                 items:[
                     {
                         layout: 'form',
                         baseCls : 'x-plain',
                         items: [new Ext.form.Radio({baseCls : 'x-plain',fieldLabel: '横向Radio Group',boxLabel:'opt1', name:'opt1'})]
                     },
                     {baseCls : 'x-plain',items: [new Ext.form.Radio({baseCls : 'x-plain',boxLabel:'opt2', name:'opt1'})]},
                     {baseCls : 'x-plain',items: [new Ext.form.Radio({baseCls : 'x-plain',boxLabel:'opt3', name:'opt1'})]},
                     {baseCls : 'x-plain',items: [new Ext.form.Radio({baseCls : 'x-plain',boxLabel:'opt3', name:'opt1'})]}
                 ]
             }]
    });

    var window = new Ext.Window( {
        title : 'Resize Me',
        width : 500,
        height : 500,
        minWidth : 300,
        minHeight : 200,
        layout : 'fit',
        plain : true,
        bodyStyle : 'padding:5px;',
        buttonAlign : 'center',
        items : form,

        buttons : [ {
            text : 'Send'
        }, {
            text : 'Cancel'
        }]
    });

    window.show();
})
